<template>
    <div class="item-container">
        <span class="label">{{map[label] ?map[label]: label }}</span>: <span class="value">{{v}}</span>
    </div>
</template>

<script>
const map = {
    username: "姓名",
    pwd: "密码",
    rePwd: "确认密码",
    phone: "账号/手机号",
    state: "账号类型"
}
import { allUserType } from "@/select/user.js";
export default {
    props: {
        label: String,
        value: String
    },
    setup(props) {
        let v = props.value;
        console.log(props);
        if (props.label === "state") {

            v = allUserType.filter(it => it.value ==
                props.value)[0].label
        }
        return {
            v
        }
    },
    data() {
        return {
            map,
            allUserType,
        }
    }

}
</script>

<style lang="less" scoped>
.item-container {
    height: 30px;
    line-height: 30px;
    font-size: 16px;
    margin: 5px 0;
}

.label {
    width: 120px;
    display: inline-block;
    text-align: left;
    color: #333
}

.value {
    display: inline-block;
    margin-left: 10px;
    text-decoration: underline;
    color: #409EFF;
}
</style>

